﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display {
    import flash.display.*;
    import flash.utils.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import Display.aswingui.*;

    public class FrameLoaderDialogView extends GenericDialogView {

        protected var m_showBeak:Boolean;

        public function FrameLoaderDialogView(_arg1:Dictionary, _arg2:String="", _arg3:Boolean=false){
            this.m_showBeak = _arg3;
            super(_arg1, _arg2);
            this.setLayout(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, 0, SoftBoxLayout.TOP));
        }
        override protected function init():void{
            m_bgAsset = (new (m_assetDict["frameLoader_bg"])() as DisplayObject);
            this.makeBackground();
            this.makeCenterPanel();
            ASwingHelper.prepare(this);
        }
        override protected function makeBackground():void{
            var _local1:MarginBackground;
            if (m_bgAsset){
                _local1 = new MarginBackground(m_bgAsset, new Insets(0, 0, 17, 0));
                this.setBackgroundDecorator(_local1);
            };
        }
        override protected function makeCenterPanel():void{
            this.appendAll(ASwingHelper.verticalStrut(10), this.makeTextPanel(), this.makeWaitingPanel(), ASwingHelper.verticalStrut(9), this.makeBeakPanel());
            ASwingHelper.prepare(this);
        }
        protected function makeTextPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local2:JLabel = ASwingHelper.makeLabel(m_message, EmbeddedArt.TITLE_FONT, 16, EmbeddedArt.orangeTextColor, JLabel.CENTER);
            _local1.appendAll(ASwingHelper.horizontalStrut(10), _local2, ASwingHelper.horizontalStrut(10));
            return (_local1);
        }
        protected function makeWaitingPanel():JPanel{
            var _local3:Bitmap;
            var _local4:AutoAnimatedBitmap;
            var _local5:AssetPane;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local2:DisplayObject = (new (m_assetDict["frameLoader_waiting"])() as DisplayObject);
            if (((_local2) && ((_local2 is Bitmap)))){
                _local3 = (_local2 as Bitmap);
                _local4 = new AutoAnimatedBitmap(_local3.bitmapData, 12, 20, 20, 15);
                _local5 = new AssetPane(_local4);
                _local1.append(_local5);
            };
            return (_local1);
        }
        protected function makeBeakPanel():JPanel{
            var _local2:DisplayObject;
            var _local3:AssetPane;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            if (this.m_showBeak){
                _local2 = (new (m_assetDict["frameLoader_beak"])() as DisplayObject);
                _local3 = new AssetPane(_local2);
                _local1.append(_local3);
            } else {
                _local1.append(ASwingHelper.verticalStrut(20));
            };
            return (_local1);
        }

    }
}//package Display 
